package com.txzhang.springcloud.orderservice.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.txzhang.springcloud.orderservice.entity.Order;
import com.txzhang.springcloud.orderservice.mapper.OrderMapper;
import org.springframework.stereotype.Service;

@Service
public class OrderService extends ServiceImpl<OrderMapper, Order> {

    public Order createOrder(Integer userId, String goodCode, Integer count) {
        Order order = new Order();
        order.setUserId(userId);
        order.setGoodCode(goodCode);
        order.setCount(count);
        baseMapper.insert(order);
        return order;
    }
}
